package org.jim.server.demo.service;

import org.jim.core.ImChannelContext;
import org.jim.core.ImPacket;
import org.jim.core.packets.Message;
import org.jim.server.adapter.MessageConverter;
import org.jim.server.adapter.MessageConverterFactory;
import org.jim.server.processor.MultiProtocolCmdProcessor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.jim.server.processor.ProtocolCmdProcessor.RunTypeEnum.RUN_TYPE_ASYNC;
import static org.jim.server.processor.ProtocolCmdProcessor.RunTypeEnum.RUN_TYPE_SYNC;

public class ToChatServiceProcessor implements MultiProtocolCmdProcessor {
    private static Logger logger = LoggerFactory.getLogger(ToChatServiceProcessor.class);
    @Override
    public void process(ImChannelContext imChannelContext, Message message) {
        logger.info("ToChatServiceProcessor收到消息=========:{}",message.toJsonString());
    }

    @Override
    public RunTypeEnum getRunType() {
        return RUN_TYPE_ASYNC;
    }

    @Override
    public boolean isProtocol(ImChannelContext imChannelContext) {
        return true;
    }
}
